package name.schooley.umarks.domain;

import javax.persistence.Entity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;
import org.springframework.roo.addon.entity.RooEntity;
import java.util.Set;
import name.schooley.umarks.domain.Bookmark;
import java.util.HashSet;
import javax.persistence.ManyToMany;
import javax.persistence.CascadeType;

@Entity
@RooJavaBean
@RooToString
@RooEntity(finders = { "findTagsByBookmarks", "findTagsByTag" })
public class Tag {

    private String tag;

    @ManyToMany(cascade = CascadeType.ALL, mappedBy = "tags")
    private Set<Bookmark> bookmarks = new HashSet<Bookmark>();
}
